﻿@if (string.IsNullOrWhiteSpace(Href))
{
    <div class="@GetClass()" @onclick="OnClick" style="@Style">
        @ChildContent
    </div>
}
else
{
    <a href="@Href" class="@GetClass()" @onclick="OnClick" target="@Target" style="@Style">
        @ChildContent
    </a>
}
@code {
    [Parameter]
    public RenderFragment ChildContent { get; set; }
    [Parameter]
    public string Href { get; set; }
    [Parameter]
    public string Target { get; set; }
    [Parameter]
    public string Class { get; set; }
    [Parameter]
    public string Style { get; set; }
    [Parameter]
    public EventCallback OnClick { get; set; }
    [Parameter]
    public bool? ShowHoverStyle { get; set; }
    [Parameter]
    public bool Outline { get; set; }
    [Parameter]
    public string Color { get; set; } = "background";

    public string GetClass()
    {
        return $"md-card {((ShowHoverStyle ?? !string.IsNullOrWhiteSpace(Href)) ? "show-hover-style" : "")} {Class} {(Outline ? "" : ("color-" + Color))}";
    }
}
